import { mainPage } from "@/router/page/index.ts";
import LazyLoadAndPermission from "../util/LazyLoadAndPermission";
import type { RouteObject } from "react-router-dom";
import message from "../message/index";
import friends from "../friends/index";
const Common: RouteObject[] = [
  {
    path: "/welcomepage",
    element: LazyLoadAndPermission(
      mainPage.Welcomepage,
      "welcomepage",
      false,
      false
    )
  },
  {
    path: "/login",
    element: LazyLoadAndPermission(mainPage.Login, "login", true, false)
  },
  {
    path: "/register",
    element: LazyLoadAndPermission(mainPage.Register, "register", true, false)
  },
  {
    path: "/home",
    element: LazyLoadAndPermission(mainPage.Home, "home", true, false),
    children: [...message, ...friends]
  }
];

export default Common;
